package org.shopen.puremvc.model.domain.theory
{
	import org.shopen.puremvc.model.domain.ISerializableMeta;
	import org.shopen.puremvc.model.utils.Convert;
	
	public class StageMeta implements ISerializableMeta
	{
		[Bindable]
		private var _id : String = "";
		[Bindable]
		public function get id() : String
		{
			return _id;
		}
		public function set id(value : String) : void
		{
			_id = value;
		}
		
		[Bindable]
		private var _title : String = "";
		[Bindable]
		public function get title() : String
		{
			return _title;
		}
		public function set title(value : String) : void
		{
			_title = value;
		}
		
		public function StageMeta(node : XML = null)
		{
			if (node != null)
			{
				deserialize(node);
			}
		}

		public function deserialize(node:XML):void
		{
			if ("@id" in node)
			{
				id = Convert.toString(node.@id);
			}
			if ("@title" in node)
			{
				title = Convert.toString(node.@title);
			}
		}
		
		public function serialize(node:XML):XML
		{
			node.@id = id;
			node.@title = title;
			return node;
		}
		
	}
}